 <#import "inc/macro-page.html" as panel>
<#escape x as x?html>
<@panel.header "首页" "">
<style>
#remind-flow-container {
    -webkit-column-width:354px; /*Safari and Chrome*/
    -moz-column-width:354px; /*Firefox*/
    -o-column-width:354px; /*Opera*/
    -ms-column-width:354px; /*IE*/
    column-width:354px;
}
#remind-flow-container>div {
	width: 354px;
	overflow: auto;
}
.btn-dark.btn-line-width {
	border-color: #fff;
}
.btn-dark.btn-line-width:hover {
	border-color: #1d2124;
}

</style>
</@panel.header>
<@panel.body>
            <!-- Container fluid  -->
            <div class="container-fluid">
                <!-- Start Page Content -->
                <div class="row m-t-50">
                    <div class="col-md-3">
                        <div class="card bg-info p-20">
                            <div class="media widget-ten">
                                <div class="media-left meida media-middle">
                                    <span><i class="fa fa-sitemap f-s-50"></i></span>
                                </div>
                                <div class="media-body media-text-right">
                                    <h4 class="color-white text-white">劳动组织预警数据</h4>
                                    <button type="button" class="btn btn-dark btn-line-width btn-outline btn-sm btn-data-upload" data-href="${ROOT}/o/upload"><i class="fa fa-upload"></i>&nbsp;导入</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="card bg-warning p-20">
                            <div class="media widget-ten">
                                <div class="media-left meida media-middle">
                                    <span><i class="fa fa-users f-s-50"></i></span>
                                </div>
                                <div class="media-body media-text-right">
                                    <h4 class="color-white text-white">员工预警数据</h4>
                                    <button type="button" class="btn btn-dark btn-line-width btn-outline btn-sm btn-data-upload" data-href="${ROOT}/w/upload"><i class="fa fa-upload"></i>&nbsp;导入</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="card bg-success p-20">
                            <div class="media widget-ten">
                                <div class="media-left meida media-middle">
                                    <span><i class="fa fa-database f-s-50"></i></span>
                                </div>
                                <div class="media-body media-text-right">
                                    <h4 class="color-white text-white">人才开发预警数据</h4>
                                    <button type="button" class="btn btn-dark btn-line-width btn-outline btn-sm btn-data-upload" data-href="${ROOT}/t/upload"><i class="fa fa-upload"></i>&nbsp;导入</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="card bg-danger p-20">
                            <div class="media widget-ten">
                                <div class="media-left meida media-middle">
                                    <span><i class="fa fa-user f-s-50"></i></span>
                                </div>
                                <div class="media-body media-text-right">
                                    <h4 class="color-white text-white">干部预警数据</h4>
                                    <button type="button" class="btn btn-dark btn-line-width btn-outline btn-sm btn-data-upload" data-href="${ROOT}/l/upload"><i class="fa fa-upload"></i>&nbsp;导入</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <#if history?? && history?size gt 0>
                <div class="row m-t-50"  id="remind-flow-container">
                    <#assign index =0>
                    <#list history as item>
                    <div class="col-lg-6 responsive-50">
                        <!-- card start -->
                        <div class="card">
                            <div class="card-title">
                                <h4>${item.name!}</h4>
                                <h6 class="card-subtitle">最后导入时间：${item.lastDate!}</h6>
                            </div>
                            <div class="card-body">
                                <#if item.histories?? && item.histories?size gt 0>
                                <ul class="timeline">
                                   <#list item.histories as child>
                                    <li>
                                        <div class="timeline-badge <#if index%4==0> primary<#elseif index%4==1> warning<#elseif index%4==2> info <#else> danger</#if>"><i class="fa fa-anchor"></i></div>
                                        <div class="timeline-panel">
                                            <div class="timeline-heading">
                                                <h5 class="timeline-title">${child.name!}</h5>
                                            </div>
                                            <div class="timeline-body">
                                                <p>上传时间：${child.lastDate!}</p>
                                            </div>
                                        </div>
                                    </li>
                                    </#list>
                                </ul>
                                </#if>
                            </div>
                        </div>
                        <!-- /# card -->
                    </div>
                    <#assign index =index+1>
                    </#list>
                </div>
                </#if>
                <!-- End PAge Content -->
                <!-- demo below-->
                <div id="treeview-checkable" class=""></div>
          		<!-- demo up -->
            </div>
            <!-- End Container fluid  -->
</@panel.body>
<@panel.footer>
<script type="text/javascript">
$(document).ready(function(){
	$('.btn-data-upload').click(function(e) {
		var href = $(this).data("href");
		swal({
			title: "数据文件上传",
			text: "<div class='dropzone remind-upload-box'></div>",
			html: true,
			confirmButtonColor: '#1976d2',
			confirmButtonText: "关闭窗口"
		});
		$('.remind-upload-box').dropzone({
			url: href,
			acceptedFiles: ".xls,.xlsx",
			maxFilesize: 20, // MB
			uploadMultiple: false,
			dictDefaultMessage: "点这里上传新文件",
			error: function(file, error) {
				console.log(error);
			},
			success: function(file, response) {
				if (response && response.code === 'ok') {
					toastr.success("文件"+file.name+"上传完成！","成功提示",{
						timeOut: 3000,
						"positionClass": "toast-top-center",
				        "showMethod": "fadeIn",
				        "hideMethod": "fadeOut"
				    });
					swal.close();
				} else {
					toastr.error(response ? response.desc : '上传失败',"错误提示",{
						timeOut: 3000,
						"positionClass": "toast-top-center",
				        "showMethod": "fadeIn",
				        "hideMethod": "fadeOut"
				    });
				}
			}
		})
	})

});
</script>
</@panel.footer>
</#escape>